import requestProxy from '@/utils/request';
const { request } = requestProxy;

// 达人解约tab列表
export function tabList(params) {
  return request({
    url: '/admin/termination/tab',
    method: 'get',
    params
  });
}
// 达人解约列表
export function terminationList(params, cancelToken) {
  return request({
    url: '/admin/termination/list',
    method: 'get',
    params,
    cancelToken
  });
}
// 达人解约删除
export function deleteTermination(id) {
  return request({
    url: `/admin/termination/delete/${id}`,
    method: 'delete'
  });
}
// 达人解约列表
export function terminationSnList(params) {
  return request({
    url: '/admin/signUp/snList',
    method: 'get',
    params
  });
}
// 达人解约详情
export function getTerminationDetail(id) {
  return request({
    url: `/admin/termination/detail/${id}`,
    method: 'get'
  });
}
// 达人解约 - 创建
export function terminationCreate(data) {
  return request({
    url: '/admin/termination/create',
    method: 'post',
    data
  });
}
// 达人解约 - 编辑
export function terminationEdit(data) {
  return request({
    url: '/admin/termination/edit/' + data.id,
    method: 'put',
    data
  });
}
// 达人解约 - 流程
export function formSubmit(data) {
  return request({
    url: '/admin/termination/formSubmit',
    method: 'post',
    data
  });
}

// 达人解约-发表评论
export function addTerminationComment(data) {
  return request({
    url: `/admin/termination/comments/add`,
    method: 'post',
    data
  });
}
// 评论列表
export function getTerminationComments(params) {
  return request({
    url: '/admin/termination/comments/list',
    method: 'get',
    params
  });
}
// 达人解约 - 流程 - 撤销
export function terminationRevocation(data) {
  return request({
    url: '/admin/termination/process/revocation',
    method: 'post',
    data
  });
}
// 签约审批 - 流程 - 撤回
export function terminationRecall(data) {
  return request({
    url: '/admin/termination/process/recall',
    method: 'post',
    data
  });
}
// 签约审批-流程审批
export function terminationAudit(data) {
  return request({
    url: '/admin/termination/process/audit',
    method: 'post',
    data
  });
}
// 是否发起合同审批
export function hasCreatedContract(id) {
  return request({
    url: `admin/termination/hasCreatedContract/${id}`,
    method: 'get'
  });
}
// 关联合同
export function associateContractRenewal(data) {
  return request({
    url: 'admin/termination/contractRenewal/associate',
    method: 'post',
    data
  });
}
// 删除关联合同
export function deleteContract(data) {
  return request({
    url: 'admin/termination/contractRenewal/delete',
    method: 'delete',
    data
  });
}
